# Contributor: Díaz Urbaneja Diego <sodomon2@gmail.com>
# Maintainer: Díaz Urbaneja Diego <sodomon2@gmail.com>
pkgname=sqlitebrowser
pkgver=3.12.0
pkgrel=0
pkgdesc="GUI editor for sqlite databases"
url="https://sqlitebrowser.org/"
arch="all"
license="GPL-3.0-only"
depends="cmake make qt5-qtbase qt5-qttools qscintilla sqlite"
makedepends="qt5-qtbase-dev qt5-qttools-dev qscintilla-dev sqlite-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/sqlitebrowser/sqlitebrowser/archive/v$pkgver.tar.gz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DENABLE_TESTING=OFF \
		$CMAKE_CROSSOPTS .
	make
}

check() {
	ctest -V
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="4a8150dfb8721a9a8c31b140ee277722319b43da242ada2da22ecc0a6f1bd1e16eef6d1037a33652156094d9c372ccfa9a772c980d3afad9cc7124b4cada01e0  sqlitebrowser-3.12.0.tar.gz"
